package one.stand.feign;

import one.stand.fallback.UserFallBack;
import one.stand.model.ResultModel;
import one.stand.request.BusinessCardRequest;
import one.stand.request.ConsultRecordRequest;
import one.stand.response.BusinessCardResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: QIK
 * @CreateDate: 2019/4/9 18:41
 */
@Component
@FeignClient(value = "user-service", fallback = UserFallBack.class, decode404 = true)
public interface UserFeign {
    /**
     * 根据用户ids获取信息
     * @param request
     * @return
     */
    @PostMapping("businessCard/getUserInfo")
    ResultModel<List<BusinessCardResponse>> getUserInfo(@RequestBody BusinessCardRequest request);

    @PostMapping("personal/unreadMessage")
    ResultModel unreadMessage(@RequestParam(value="sendUserId") Integer sendUserId, @RequestParam(value="receiveUserId") Integer receiveUserId, @RequestParam(value="text") String text, @RequestParam(value="type") Integer type);

    /**
     * 添加咨询记录
     * @param request
     * @return
     */
    @PostMapping("record/addConsultRecord")
    ResultModel addConsultRecord(@RequestBody ConsultRecordRequest request);



}
